package com.zzyang.c2c.social.govern.report.mapper;

import com.zzyang.c2c.social.govern.report.domain.ReportTask;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;

/**
 * mapper
 *
 * @author zhuoziyang
 * @date 2021/7/26 15:52
 */
public interface ReportTaskMapper {

    @Insert("insert into c2c_report_task(type,report_user_id,report_content,target_id,vote_result)" +
            " values(#{type},#{reportUserId},#{reportContent},#{targetId},#{voteResult})")
    @Options(keyProperty = "id", keyColumn = "id", useGeneratedKeys = true)
    void insert(ReportTask reportTask);

    /**
     * 根据id查找
     *
     * @param id
     * @return
     */
    ReportTask selectById(@Param("id") Long id);

    /**
     * 根据id修改投票结果
     *
     * @param id
     * @param voteResult
     */
    void updateVetoResultById(@Param("id") Long id, @Param("voteResult") Integer voteResult);

}
